import request from '@/utils/request'
export default {
  // 新增
  save(data){
    return request({
      url: `/jiaban/add`,
      method: 'post',
      data
    })
  },
  // /jiaban/edit/{id}
  // 编辑
  edit(data){
    return request({
      url: `/jiaban/edit/${data.jiaBanId}`,
      method: 'post',
      data
    })
  },
  // 加班管理
  list(page){
    return request({
      url: `/jiaban/index`,
      method: 'get',
      params:{pageIndex:page.index,pageSize:page.size}
    })
  },
  // api/jiaban/auditList
  // 请假审批列表
  auditList(page){
    return request({
      url: `/jiaban/auditList`,
      method: 'get',
      params:{pageIndex:page.index,pageSize:page.size}
    })
  },
  ///api/jiaban/doAudit/{id}
  // 请假审批
  doAudit(id,data){
    return request({
      url: `/jiaban/doAudit/${id}`,
      method: 'post',
      data
    })
  },
  doAuditBack(id) {
    return request({
      url: `/jiaban/doAuditBack/${id}`,
      method: 'post'
    })
  },
  // api/jiaban/info/{id}
  // 详情
  getById(id){
    return request({
      url: `/jiaban/info/${id}`,
      method: 'get'
    })
  },
  // /api/jiaban/deleteByIds
  // 根据id批量删除通知列表
  delete(arr){
    return request({
      url: `/jiaban/deleteByIds`,
      method: 'delete',
      data:arr
    })
  },
  getFlowList(id){
    return request({
      url: `/jiaban/flowList/${id}`,
      method: 'get'
    })
  },

  // qingjia/getliuChengJianKongList
  // 请假流程列表
  auditLists(pageuser){
    return request({
      url: `/jiaban/getliuChengJianKongList`,
      method: 'get',
      params:pageuser
    })
  },

// /qingjia/stateList
  //类型下拉框
  seleAlls(){
    return request({
      url: `/jiaban/stateList`,
      method: 'get',
    })
  },
  getliuChengJianKongList(letterState,name,pageIndex,pageSize){
    return request({
      url: `/jiaban/getliuChengJianKongList`,
      method: 'get',
      params: {letterState,name,pageIndex,pageSize}
    })
  },
  // /jiaban/tongji
  // 统计汇总
  tongji(departmentId,year,month,pageIndex,pageSize){
    return request({
      url: `/jiaban/tongji`,
      method: 'get',
      params: {departmentId,year,month,pageIndex,pageSize},
    })
  },
  ///jiaban/getListByUid
  // 获取个人的
  getListByUid(userId,year,month){
    return request({
      url: `/jiaban/getListByUid`,
      method: 'get',
      params: {userId,year,month},
    })
  },
  // /jiaban/stateList
  // 加班状态
  stateList(){
    return request({
      url: `/jiaban/stateList`,
      method: 'get',
    })
  }

}
